<#assign menu="report">
<#assign submenu="report_list">
<#include "/system/head.ftl">
<style type="text/css" xmlns="http://www.w3.org/1999/html">
    .pagination {
        border-radius: 4px;
        display: inline-block;
        margin: 0;
        padding-left: 0;
    }

    /* Portlet */
    .portlet > .portlet-body.green,
    .portlet.green {
        background-color: white;
    }

    table tr{
        text-align: center;
    }

    th{
        text-align: center;
    }


</style>

<body>

<section id="main-content">
    <section class="wrapper">


        <div class="row">
            <div class="col-md-12">
                <div class="portlet box grey-cascade">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="fa fa-globe"></i>推送管理
                        </div>
                        <div class="tools">
                            <a href="javascript:;" class="collapse">
                            </a>
                            <a href="javascript:;" class="reload">
                            </a>
                            <a href="javascript:;" class="remove">
                            </a>
                        </div>
                    </div>
                    <div class="portlet-body">
                        <div class="table-toolbar">
                            <div class="btn-group">
                                <a href="${basePath}/admin/push/add.htm" class="btn green" id="sample_editable_1_new">
                                    添加 <i class="fa fa-plus"></i>
                                </a>
                            </div>
                        </div>

                        <table  class="table table-striped table-bordered table-hover" id="sample_1">
                            <thead>
                            <tr>
                                <th class="table-checkbox">
                                    <input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/>
                                </th>
                                <th>编号</th>
                                <th>举报人Id</th>
                                <th>原因</th>
                                <th>内容</th>
                                <th>被举报人Id</th>
                                <th>活动Id</th>
                                <th>帖子id</th>
                                <th>是否处理</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <#list reportList as e>
                            <tr class="gradeA odd">
                                <td>
                                    <input type="checkbox" class="checkboxes" value="1"/>
                                </td>
                                <td>
                                ${e.id}
                                </td>
                                <td>
                                    <a href="${basePath}/admin/appUser/search.htm?appUserId=${e.myId}" class="label label-sm label-warning">${e.myId}</a>
                                </td>
                                <td>
                                ${e.reportRs}
                                </td>
                                <td>
                                ${e.content!}
                                </td>
                                <td>
                                    <a href="${basePath}/admin/appUser/search.htm?appUserId=${e.toId}" class="label label-sm label-warning">${e.toId}</a>
                                </td>
                                <td>
                                    <a href="${basePath}/admin/events/search.htm?eventsId=${e.eventsId}" class="label label-sm label-warning">${e.eventsId}</a>
                                </td>
                                <td>
                                    <a href="${basePath}/admin/eventComments/detail.htm?eventCommentsId=${e.eventCommentsId}" class="label label-sm label-warning">${e.eventCommentsId}</a>
                                </td>
                                <td>
                                    <#if e.status==1>
                                        <span class="label label-sm label-success">未处理</span>
                                    <#else >
                                        <span class="label label-sm label-default">已处理</span>

                                    </#if>
                                </td>
                                <td>
                                    <a href="${basePath}/admin/appUser/takeOff.json?appUserId=${e.toId}" title="禁用用户"
                                       class="btn btn-sm blue">
                                        禁用用户
                                    </a>
                                    <a href="${basePath}/admin/eventComments/takeOff.json?=${e.id}" title="删除帖子"
                                       class="btn btn-sm blue">
                                        删除帖子
                                    </a>
                                </td>
                            </tr>
                            </#list>

                            </tbody>
                        </table>
                    </div>

                </div>

            </div>
        </div>

    </section>
</section>
</body>
<#include "../foot.ftl">

<script>
    var TableManaged = function () {
        return {
            //main function to initiate the module
            init: function () {
                if (!jQuery().dataTable) {
                    return;
                }
                // begin first table
                $('#sample_1').dataTable({
                    "aoColumns": [
                        { "bSortable": false },
                        { "bSortable": true },
                        { "bSortable": false },
                        { "bSortable": false},
                        { "bSortable": false},
                        { "bSortable": false},
                        { "bSortable": false},
                        { "bSortable": false},
                        { "bSortable": false},
                        { "bSortable": false}
                    ],
                    "aLengthMenu": [
                        [5, 15, 20, -1],
                        [5, 15, 20, "All"] // change per page values here
                    ],
                    // set the initial value
                    "iDisplayLength": 5,
                    "sPaginationType": "bootstrap",
                    "oLanguage": {
                        "sLengthMenu": "_MENU_ records",
                        "oPaginate": {
                            "sPrevious": "Prev",
                            "sNext": "Next"
                        }
                    },
                    "aoColumnDefs": [
                        { 'bSortable': false, 'aTargets': [0] },
                        { "bSearchable": false, "aTargets": [ 0 ] }
                    ]
                });

                jQuery('#sample_1 .group-checkable').change(function () {
                    var set = jQuery(this).attr("data-set");
                    var checked = jQuery(this).is(":checked");
                    jQuery(set).each(function () {
                        if (checked) {
                            $(this).attr("checked", true);
                            $(this).parents('tr').addClass("active");
                        } else {
                            $(this).attr("checked", false);
                            $(this).parents('tr').removeClass("active");
                        }
                    });
                    jQuery.uniform.update(set);
                });

                jQuery('#sample_1').on('change', 'tbody tr .checkboxes', function(){
                    $(this).parents('tr').toggleClass("active");
                });

                jQuery('#sample_1_wrapper .dataTables_filter input').addClass("form-control input-medium input-inline"); // modify table search input
                jQuery('#sample_1_wrapper .dataTables_length select').addClass("form-control input-xsmall input-inline"); // modify table per page dropdown


            }
        };
    }();
    TableManaged.init();
</script>

